package com.frxuexi.park2212.sign

import androidx.lifecycle.MutableLiveData
import com.frxuexi.lib_base.base.BaseViewModel
import com.frxuexi.lib_base.entity.SignBean
import com.frxuexi.lib_base.entity.SignBeanItem
import com.frxuexi.lib_base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignViewModel @Inject constructor(val apiService: ApiService):BaseViewModel() {

    var getSigns = MutableLiveData<SignBean>()

    var sign = MutableLiveData<SignBeanItem>()

    fun getSigns(uid:Int){
        httpRequest({apiService.getSigns(uid)},getSigns::postValue)
    }

    fun sign(item: SignBeanItem){
        httpRequest({apiService.sign(toBody(item))},sign::postValue)
    }
}